home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / wordpro / we16_95g.zip / WINEDIT.MN_ < prev    next >
Text File  |  1995-12-06  |  26KB  |  749 lines

  1. ;WINEDIT.MNU file.
  2. ;
  3. ;Modifications courtesy of Don Lekei, Richard Merit, Morrie Wilson
  4. ; and many many others.  Thank you very much.
  5. ;
  6. ; Some functions, like version control and alternate grep commands, 
  7. ; are presented here but commented out.  If you have the corresponding
  8. ; utility, just delete the semicolons from column 1 and the function
  9. ; will be enabled.
  10. ;
  11. ;
  12. ;
  13. ; AutoExec Section is on top here.
  14. ;
  15.         TAB=num2char(9)
  16.         CR=strcat(num2char(13),num2char(10))
  17.         EOL=strcat(num2char(13))
  18.         Home=DirHome()
  19.         IntControl(29,@tab,0,0,0)  ;Standardize on tabs as delimiters for FileItemize, etc
  20.  
  21. Edit Utility Menu   ; Manage WinEdit Utility menu and help files
  22.         TheFile=strcat(DirHome(),"WINEDIT.MNU")
  23.         WFileOpen(TheFile)
  24.         Drop(TheFile)
  25. ;
  26. ;Adds a function to load the error file on CTRL-E
  27. ;
  28. Read Error File  \^E ; Read WinEdit error file menu and help files
  29.         wViewOutput()
  30.  
  31. Edit Macro Menu   ; Manage WinEdit Macro menu
  32.         ; In the lite and standard versions of WinEdit,
  33.         ; the MACRO.ENC file is not editable.
  34.         ; In the Pro version, the file MACRO.MNU is used
  35.         ; and it can be edited.
  36.         level=2
  37.         a = FileLocate("WINEDIT.INI")
  38.         if FileExist(a) then level=IniReadPvt("WINEDIT","LEVEL","2",a)
  39.         if (level < 2) then Message("Edit Macro Menu","The Macro Menu cannot be edited in the Lite or Standard versions of WinEdit")
  40.         if (level < 2) then exit
  41.         ; else we can edit it
  42.         TheFile=strcat(DirHome(),"MACRO.MNU")
  43.         WFileOpen(TheFile)
  44.         Drop(TheFile)
  45.  
  46. _Key Word Help      \ +{F1}         ; Load help topic for word at cursor
  47.         call("wwwedit.dll","KEYWORDHELP")
  48. ;
  49. Insert Block
  50.  If-Else
  51.      wEdNewLine()
  52.      wEdUpLine()
  53.      ; First determine if it is C or WIL
  54.      ;debug(1)
  55.      filext = FileExtension(wGetFileName())
  56.      if filext=="WBT" || filext=="WIL" || filext=="MNU"   ; Its WIL
  57.         wEdInsString("if  xx == yy")
  58.         wEdNewLine()
  59.         wEdNewLine()
  60.         wEdInsString("else")
  61.         wEdNewLine()
  62.         wEdNewLine()
  63.         wEdInsString("endif")
  64.         wEdNewLine()
  65.         wEdUpLine()
  66.         wEdUpLine()
  67.         wEdUpLine()
  68.         wEdUpLine()
  69.      else  ;assume C
  70.         wEdInsString("if  ( xx == yy )")
  71.         wEdNewLine()
  72.         wEdInsString("   {")
  73.         wEdNewLine()
  74.         wEdNewLine()
  75.         wEdInsString("}")
  76.         wEdNewLine()
  77.         wEdLeft()
  78.         wEdLeft()
  79.         wEdLeft()
  80.         wEdInsString("else")
  81.         wEdNewLine()
  82.         wEdInsString("   {")
  83.         wEdNewLine()
  84.         wEdNewLine()
  85.         wEdInsString("}")
  86.         wEdNewLine()
  87.         wEdUpLine()
  88.         wEdUpLine()
  89.         wEdUpLine()
  90.         wEdUpLine()
  91.         wEdUpLine()
  92.         wEdUpLine()
  93.      endif
  94.      drop(s,filext)
  95.  Switch
  96.      wEdNewLine()
  97.      wEdUpLine()
  98.      filext = FileExtension(wGetFileName())
  99.      if filext=="WBT" || filext=="WIL" || filext=="MNU"   ; Its WIL
  100.         wEdNewLine()
  101.         wEdUpLine()
  102.         wEdInsString("switch switchvar")
  103.         wEdNewLine()
  104.         wEdInsString("   case 1")
  105.         wEdNewLine()
  106.         wEdInsString("   break")
  107.         wEdNewLine()
  108.         wEdNewLine()
  109.         wEdLeft()
  110.         wEdLeft()
  111.         wEdLeft()
  112.         wEdInsString("case 2")
  113.         wEdNewLine()
  114.         wEdInsString("   break")
  115.         wEdNewLine()
  116.         wEdNewLine()
  117.         wEdLeft()
  118.         wEdLeft()
  119.         wEdLeft()
  120.         wEdInsString("case 3")
  121.         wEdNewLine()
  122.         wEdInsString("   break")
  123.         wEdNewLine()
  124.         wEdNewLine()
  125.         wEdLeft()
  126.         wEdLeft()
  127.         wEdLeft()
  128.         wEdLeft()
  129.         wEdLeft()
  130.         wEdLeft()
  131.         wEdInsString("endswitch")
  132.         wEdNewLine()
  133.         wEdUpLine()
  134.         wEdUpLine()
  135.         wEdUpLine()
  136.         wEdUpLine()
  137.         wEdUpLine()
  138.         wEdUpLine()
  139.         wEdUpLine()
  140.         wEdUpLine()
  141.         wEdUpLine()
  142.      else  ;assume C
  143.         wEdInsString("switch (swvar)")
  144.         wEdNewLine()
  145.         wEdInsString("   {")
  146.         wEdNewLine()
  147.         wEdInsString("case 1:")
  148.         wEdNewLine()
  149.         wEdInsString("   break;")
  150.         wEdNewLine()
  151.         wEdNewLine()
  152.         wEdLeft()
  153.         wEdLeft()
  154.         wEdLeft()
  155.         wEdInsString("case 2:")
  156.         wEdNewLine()
  157.         wEdInsString("   break;")
  158.         wEdNewLine()
  159.         wEdNewLine()
  160.         wEdLeft()
  161.         wEdLeft()
  162.         wEdLeft()
  163.         wEdInsString("case 3:")
  164.         wEdNewLine()
  165.         wEdInsString("   break;")
  166.         wEdNewLine()
  167.         wEdNewLine()
  168.         wEdLeft()
  169.         wEdLeft()
  170.         wEdLeft()
  171.         wEdLeft()
  172.         wEdLeft()
  173.         wEdLeft()
  174.         wEdInsString("   }")
  175.         wEdNewLine()
  176.         wEdUpLine()
  177.         wEdUpLine()
  178.         wEdUpLine()
  179.         wEdUpLine()
  180.         wEdUpLine()
  181.         wEdUpLine()
  182.         wEdUpLine()
  183.         wEdUpLine()
  184.         wEdUpLine()
  185.      endif
  186.      drop(s,filext)
  187.  While
  188.      wEdNewLine()
  189.      wEdUpLine()
  190.      filext = FileExtension(wGetFileName())
  191.      if filext=="WBT" || filext=="WIL" || filext=="MNU"   ; Its WIL
  192.         wEdInsString("while xx == yy")
  193.         wEdNewLine()
  194.         wEdNewLine()
  195.         wEdInsString("endwhile")
  196.         wEdNewLine()
  197.         wEdUpLine()
  198.         wEdUpLine()
  199.      else  ;assume C
  200.         wEdInsString("while (xx == yy)")
  201.         wEdNewLine()
  202.         wEdInsString("   {")
  203.         wEdNewLine()
  204.         wEdNewLine()
  205.         wEdInsString("}")
  206.         wEdNewLine()
  207.         wEdUpLine()
  208.         wEdUpLine()
  209.      endif
  210.      drop(s,filext)
  211.  Comment block       \ +^B
  212.         filext = FileExtension(wGetFileName())
  213.         if filext=="WBT" || filext=="WIL" || filext=="MNU"  then cmt=";" ; Its WIL
  214.               else cmt="//"
  215.         s=""
  216.         ;if wGetSelState() then
  217.         s=wEdGetWord()
  218.         clipput ("%cmt%***************************************************************************%CR%")
  219.         clipappend("%cmt%** %s%%CR%")
  220.         clipappend("%cmt%** %CR%")
  221.         clipappend("%cmt%** %CR%")
  222.         clipappend ("%cmt%***************************************************************************%CR%")
  223.         wEDgotocol(1) ;insert above current line
  224.         wedstartsel()
  225.         wedendsel()
  226.         wednewline()
  227.         wEDgotocol(1) ;insert above current line
  228.         Wedpaste()
  229.         weddownline()
  230.         weddownline()
  231.         wedend()
  232.         drop(s,filext,cmt)
  233. ;
  234. ;Builds a DETAILED comment block from the label under the cursor.
  235. ;
  236.  Comment SUPER block       \ ^!B
  237.         filext = FileExtension(wGetFileName())
  238.         if filext=="WBT" || filext=="WIL" || filext=="MNU"  then cmt=";" ; Its WIL
  239.               else cmt="//"
  240.         s=""
  241.         ;if wGetSelState() then
  242.         s=wEdGetWord()
  243.         clipput ("%cmt%***************************************************************************%CR%")
  244.         clipappend("%cmt%** %s%%CR%")
  245.         clipappend("%cmt%** %CR%")
  246.         clipappend("%cmt%** %CR%")
  247.         clipappend("%cmt%** Inputs: %CR%")
  248.         clipappend("%cmt%** Outputs: %CR%")
  249.         clipappend("%cmt%** Preserves: %CR%")
  250.         clipappend("%cmt%** Corrupts: %CR%")
  251.         clipappend ("%cmt%***************************************************************************%CR%")
  252.         wEDgotocol(1) ;insert above current line
  253.         wedstartsel()
  254.         wedendsel()
  255.         wednewline()
  256.         wEDgotocol(1) ;insert above current line
  257.         Wedpaste()
  258.         weddownline()
  259.         weddownline()
  260.         wedend()
  261.         drop(s,filext,cmt)
  262. ;
  263. ;Merge File header comment file from disk
  264. ;
  265. ;Header Block    \ ^!H
  266. ;        Wedgotoline(1)
  267. ;        WedGotoCol(1)
  268. ;        wFileMerge("header")
  269.  
  270. ;
  271. ;Shells external process to produce fancy printout of a file
  272. ;         
  273. ;Hardcopy        \ ^H
  274. ;        n=wGetfilename()
  275. ;        cmd="-o=10 -l,l %n% > lpt1"
  276. ;        AskLine("Hardcopy","Enter hardcopy command:",cmd)
  277. ;        wRunCommand("DOSPRMPT.PIF /c hcopy %cmd%",@FALSE,@FALSE)
  278. ;        drop (n,cmd)
  279.  
  280. Load Help File                    ; Load a help file (no keyword lookup)
  281.         TheFile=strcat(DirHome(),"HELP\WEHELP.INI")
  282.         Keys=IniItemizePvt("HelpAll",TheFile)
  283.         KeyMax=ItemCount(Keys,@TAB)
  284.         KeyIndex=0
  285.         KeyValues=""
  286.  
  287.         :ieLoop
  288.         if KeyIndex==KeyMax then goto looped
  289.         KeyIndex=KeyIndex+1
  290.         ThisKey=ItemExtract(KeyIndex,Keys,@TAB)
  291.         if (stricmp(ThisKey,"DEFAULT")==0) then goto ieloop
  292.         ThisValue=IniReadPvt("HelpAll",ThisKey,"???",TheFile)
  293.         KeyValues=strcat(KeyValues,ThisValue,"|")
  294.         goto ieLoop
  295.         
  296.         :looped
  297.         a=ItemSelect("Select Help File",strlower(KeyValues),"|")
  298.         if a=="" then goto DONE
  299.         b = FileLocate(strcat(DirHome(),"HELP\%a%"))
  300.         if b=="" then b=FileLocate(a)
  301.         if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
  302.                  else WinHelp(b,"CONTENTS","")
  303.         :DONE
  304.         Drop(TheFile,Keys,KeyMax,KeyIndex,KeyValues,ThisKey,ThisValue,a,b)
  305. ;
  306. ; Open the file under the cursor or marked
  307. ;
  308. Open highlighted file    \ ^F       ; Open selected file
  309.         name = wEdGetWord()
  310.         length = strlen(name)
  311.         if length==0 then goto DONE
  312.         b = FileLocate(name)
  313.         if b == "" then Message("Open selected file","Cannot find %name%")
  314.         if b == "" then goto DONE
  315.         wFileOpen(b)
  316.         :DONE
  317.         drop(name,length,b)
  318. ;
  319. ;
  320. ;        
  321. ;Delete to end of word. A real, proper, sane one. Like the good old days!
  322. ;If the cursor is in/before text, the rest of the word will be deleted.
  323. ;If the cursor is in whitespace, the rest of the whitespace will be deleted
  324. ;If the cursor is at the end of line, the next line will be concatinated
  325. ;
  326. ;
  327. Delete to end of word   \ ^T
  328.         col = wgetcolno()             ;save current posn
  329.         wedend()
  330.         e = wgetcolno()               ;Find end of line
  331.         if col>=e then goto Dend      ;end of line -- do delete! (concat lines)
  332.         wedgotocol(col)               ;back where we started
  333.         c1=wgetchar()
  334.         wEdStartSel()
  335.         :loop
  336.         wedright()
  337.         if wgetcolno() < e then c=wgetchar()
  338.         else c=""
  339.         if !strcmp(c1," ") then if !strcmp(c," ") then goto loop
  340.         if strcmp(c1," ") then if strlen(c) then if strcmp(c,"!")>=0 then if ((strcmp(c,":")<0) || (strcmp(c,"?")>0)) then goto loop
  341.         wEdEndSel()
  342.         :Dend
  343.         wEdDelete()
  344.         drop(c)
  345. ;
  346. ;
  347. ;
  348.  
  349. Generate C Tags                   ; Index source files
  350.         ; uses the TAGS.EXE program to generate WINEDIT.MRK file
  351.         ; that the next function uses to look up function names
  352.         ; in your source
  353.         RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
  354.         Message("Tags","Processing complete")
  355.  
  356. Go to tag                         ; Jump to function definition
  357.         ; looks up the current word in WINEDIT.MRK, loads the file,
  358.         ; and moves the cursor to the correct line
  359.         ;DEBUG(1)
  360.         goto START
  361.         :GETWORD
  362.         a = AskLine("Go to tag", "Enter function definition to jump to:", "")
  363.         strupper(a)
  364.         len = strlen(a)
  365.         if len==0 then goto NOWORD
  366.         goto START2
  367.         :START
  368.         a=WEdGetWord()
  369.         strupper(a)
  370.         len = strlen(a)
  371.         if len==0 then goto GETWORD
  372.         :START2
  373.         b=FileLocate("winedit.mrk")
  374.         WFileOpen(b)
  375.         WFind(a,@TRUE,@FALSE)
  376.         WEdHome()
  377.         WEdStartSel()
  378.         WEdEnd()
  379.         WEdEndSel()
  380.         WEdCopy()
  381.         WWinClose()
  382.         line=ClipGet()
  383.         line2=strupper(line)
  384.         c=StrIndex(line2,a,0,@FWDSCAN)
  385.         d=StrIndex(line2," ",c,@FWDSCAN)
  386.         e=StrIndex(line2,"(",d,@FWDSCAN)
  387.         filename=StrSub(line2,d,e-d)
  388.         lineno=StrSub(line2,e+1,strlen(line2)-e-1)
  389.         WFileOpen(filename)
  390.         WEdGoToLine(lineno)
  391.         WEdHome()
  392.         Drop(len,b,line,line2,c,d,e,filename,lineno)
  393.         :NOWORD
  394.         Drop(a)
  395. ;
  396.  
  397. Grep    \      ^G             ; Run fgrep
  398.         a = "fgrep.com"
  399.         b = FileLocate(strcat(DirHome(),a))
  400.         if b=="" then b=FileLocate(a)
  401.         if b=="" then Message("Error","Fgrep utility not found.  You can download fgrep.com from our BBS.  (206)935-5198")
  402.                  then goto DONE
  403.         GrepWord = wEdGetWord()         ; Get Selected word if any
  404.         command = AskLine("Grep","Enter the grep commmand to run:","tee.com %b% -M %GrepWord% *.c")
  405.         wRunCommand(command,@TRUE,@TRUE)
  406.         :DONE
  407.         Drop(command,GrepWord,a,b);
  408.  
  409.  
  410. ;Multifile grep command. Expects to fine unix-compatable grep AND gres
  411. ;commands in the path!  It parses the result into an error file so that 
  412. ;next and previous error works 
  413. ;
  414.  
  415. ;Grep    \      ^G             ; Run fgrep
  416. ;        Tee=strcat(DirHome(),"tee.com")
  417. ;        Where=strlower(StrSub(dirget(),1,strlen(dirget())-1))
  418. ;        drv=StrSub(Where,1,2)
  419. ;        ext=strlower(fileExtension(wGetFilename()))
  420. ;        if (ext=="c"|ext=="h") then ext = "?"
  421. ;        GrepWord = wEdGetWord()         ; Get Selected word if any
  422. ;        command = GrepWord
  423. ;        command = AskLine("Grep (multifile)","Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter text to find: ","%GrepWord%")
  424. ;        wRunCommand("grep -n %command% %Where%\*.%ext%|gres '^(..[^:]*)(: )([0-9][0-9]*)(: )' '\1 \3 Error:'",@TRUE,@TRUE)
  425. ;        Drop(command,GrepWord,Tee,Where,drv)
  426. ;
  427.  
  428.  
  429. ;Improved toggle-case macro for Winedit 3.1
  430. ;
  431. Toggle case     \ ^Q
  432.         a = wGetSelState()
  433.         if a == 1 then goto selection
  434.         a = wGetChar()
  435.         if (a == StrLower(a)) then a = StrUpper(a)
  436.         else a = StrLower(a)
  437.         wEdDelete()
  438.         wEdInsString(a)
  439.         Drop(a)
  440.         exit
  441.         :selection
  442.         line = wGetLineNo()
  443.         col = wGetColNo()
  444.         wEdCut()
  445.         a=clipget()
  446.         if (a == StrLower(a)) then ClipPut(StrUpper(a))        
  447.         else ClipPut(StrLower(a))        
  448.         wEdPaste()
  449.         wEdStartSel()
  450.         wEdGotoLine(line)
  451.         wEdGotoCol(col)
  452.         wEdEndSel()
  453.         drop (a,line,col)
  454. ;
  455. ;Version Control for use with RCS
  456. ;
  457. ;&Version Control           ; RCS commands
  458. ;; Lock/get file (co -l)  \ ^!F
  459. ;;        opt2="-l"
  460. ;;        goto lgf2
  461. ; Get file (co)          \ ^!O  
  462. ;        opt2=""
  463. ;        :lgf2
  464. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  465. ;        drv=StrSub(Where,1,2)
  466. ;        b=wGetFileName()
  467. ;        if b==1 then b=""
  468. ;        if wGetSelState() then s=wEdGetWord()
  469. ;           else s=b
  470. ;        a = AskLine("RCS Checkout %opt2%", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file you want to lock:", s)
  471. ;        ParseData(a)
  472. ;        s=fileroot(param%param0%)
  473. ;        if s==fileroot(b) then wWinClose()
  474. ;           else if b!="" then if AskYesNo("%a% is not the active file.%CR% %CR%Close Files","Close all files before continuing?")==@YES then wWinCloseall()
  475. ;
  476. ;;OS/2 Version
  477. ;;        wRunCommand("%drv% |cd %Where%|wetee co %opt2% %a%",@FALSE,@TRUE)
  478. ;;        pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  479. ;;DOS/WIN Version
  480. ;        wRunCommand("%drv% |cd %Where%|wetee co %opt2% %a%",@TRUE,@TRUE)
  481. ;      
  482. ;         Wfileopen(b)
  483. ;        b=FileLocate(a)
  484. ;        if b=="" then goto NotFound
  485. ;          WFileOpen(b)
  486. ;          goto DONE
  487. ;        :NotFound
  488. ;          Message("Sorry", "%a% not found...")
  489. ;          goto Done
  490. ;        :DONE
  491. ;        Drop(a)
  492. ;        Drop(b,Where,drv,s)
  493. ;
  494. ; Checkin file (ci)     \ ^!I
  495. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  496. ;        drv=StrSub(Where,1,2)
  497. ;        b=wGetFileName()
  498. ;        if b==1 then b=""
  499. ;        if wGetSelState() then s=wEdGetWord()
  500. ;           else s=b
  501. ;        a = AskLine("RCS Checkin (unlock)", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file you want to put back:",s )
  502. ;        ParseData(a)
  503. ;        s=fileroot(param%param0%)
  504. ;        if s==fileroot(b) then wWinClose() 
  505. ;           else if AskYesNo("%a% is not the active file.%CR% %CR%Close Files","Close all files before continuing?")==@YES then wWinCloseall()
  506. ;        wRunCommand("%drv% |cd %Where%|wetee ci %a%",@TRUE,@TRUE)
  507. ;;(if OS/2)     pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  508. ;        wfileopen(b) ; reopen original window
  509. ;        Drop(a,Where,drv,b,s)
  510. ;
  511. ; Enter any command (clean)     \ ^!C
  512. ;        Where=StrSub(dirget(),1,strlen(dirget())-1)
  513. ;        drv=StrSub(Where,1,2)
  514. ;        b=wGetFileName()
  515. ;        if b==1 then b=""
  516. ;        if wGetSelState() then s=wEdGetWord()
  517. ;           else s=strcat("rcsclean ",b)
  518. ;        a = AskLine("Any Command", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter command:", s)
  519. ;        ParseData(a)
  520. ;        s=fileroot(param%param0%)
  521. ;        if s==fileroot(b) then wWinClose()
  522. ;           else if AskYesNo("Close Files","%S% is not the active file.%CR% %CR%Close all files before continuing?")==@YES then wWinCloseall()
  523. ;        wRunCommand("%drv% |cd %Where%|%a%",@TRUE,@TRUE)
  524. ;;if OS/2        pause("OS/2 Bug","Tell the stupid OS/2 when the program is done!")
  525. ;        wfileopen(b)
  526. ;        Drop(a,b,s,Where,drv)
  527. ;
  528. ;; &Logfile Info (locked)
  529. ;;        a = AskLine("PVCS Logfile Command", "Drive:  %drv%   Dir:  %Where% %CR% %CR%Enter file for which you want logfile info:", "")
  530. ;;        a=strcat("tee vlog -BL ",a)
  531. ;;        wRunCommand(a,@TRUE,@TRUE)
  532. ;;        Drop(a,Where,drv)
  533. ;
  534. ;; &Update all source files
  535. ;;        wRunCommand("tee get -u *.??v",@TRUE,@TRUE)
  536. ;
  537. ;
  538. ;&Version Control          ; PVCS commands
  539. ; &Get a file (w/lock)
  540. ;        a = AskLine("PVCS Get (w/lock) Command", "Enter file you want to lock:", "")
  541. ;        b=strcat("tee get -L ",a)
  542. ;        wRunCommand(b,@TRUE,@TRUE)
  543. ;        Drop(b)
  544. ;        b=FileLocate(a)
  545. ;        if b=="" then goto NotFound
  546. ;          WFileOpen(b)
  547. ;          goto DONE
  548. ;        :NotFound
  549. ;          Message("???", "%a% not found...")
  550. ;          goto Done
  551. ;        :DONE
  552. ;        Drop(a)
  553. ;        Drop(b)
  554. ;
  555. ; &Put a file back (unlock)
  556. ;        a = AskLine("PVCS Put (unlock) Command", "Enter file you want to put back:", "")
  557. ;        a=strcat("tee put ",a)
  558. ;        wRunCommand(a,@TRUE,@TRUE)
  559. ;        Drop(a)
  560. ;
  561. ; &Enter any PVCS command
  562. ;        a = AskLine("PVCS Command", "Enter PVCS command:", "")
  563. ;        a=strcat("tee ",a)
  564. ;        wRunCommand(a,@TRUE,@TRUE)
  565. ;        Drop(a)
  566. ;
  567. ; &Logfile Info (locked)
  568. ;        a = AskLine("PVCS Logfile Command", "Enter file for which you want logfile info:", "")
  569. ;        a=strcat("tee vlog -BL ",a)
  570. ;        wRunCommand(a,@TRUE,@TRUE)
  571. ;        Drop(a)
  572. ;
  573. ; &Update all source files
  574. ;        wRunCommand("tee get -u *.??v",@TRUE,@TRUE)
  575. ;
  576. ;;
  577.  
  578. Utilities      ;      Select from list of utilities
  579.  &Freespace on Local Drives   ; Display free disk space on drives
  580.  
  581.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  582.         Dmax=strlen(Drive)
  583.         DIndex=1
  584.         TotalSize=0
  585.         DriveReport=""
  586.  
  587.         :COUNTSPACE
  588.         NextDrive=StrSub(Drive,Dindex,1)
  589.         a=DiskFree(NextDrive)/1024
  590.         TotalSize=a+TotalSize
  591.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  592.         DIndex=Dindex+3  ;each entry is 3 bytes long
  593.         if DIndex<=Dmax then goto COUNTSPACE
  594.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  595.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  596.  
  597.  &Wallpaper                   ; Change the desktop wallpaper
  598.            DirChange(dirWindows(0))
  599.            a=FileItemize("*.BMP")
  600.            a=strcat("-None- ",a)
  601.            a=ItemSelect("Select New Wallpaper",a,@tab)
  602.            terminate(a=="","Wallpaper","No wallpaper selected")
  603.            if a=="-None-" then Wallpaper("",0)
  604.            if a=="-None-" then exit
  605.            tile=@FALSE
  606.            if FileSize(a)<40000 then tile=@TRUE  
  607.            ;if bmp size less than 40K, assume tile, else center
  608.            Wallpaper(a,tile)
  609.            drop(a,b,tile)
  610.         exit
  611.  
  612.  Paste Special Characters             ; Paste high ASCII characters to clipboard or document
  613.   Copy &FormFeed to Clipboard
  614.        Clipput(Num2char(12))
  615.   Copy &Special Characters to Document
  616.        a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|"       ;161 thru 170
  617.        b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|"       ;171 thru 180
  618.        c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|"       ;181 thru 190
  619.        d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|"       ;191 thru 200
  620.        e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|"       ;201 thru 210
  621.        f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|"       ;211 thru 220
  622.        g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|"       ;221 thru 230
  623.        h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|"       ;231 thru 240
  624.        i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|"       ;241 thru 250
  625.        j=" √| ⁿ| ²| ■|  "                       ;251 thru 255
  626.        a=strcat(a,b,c,d,e,f,g,h,i,j)
  627.        Drop(b,c,d,e,f,g,h,i,j)
  628.        a=ItemSelect("Choose a character",a,"|")
  629.        a=strsub(a,2,1)
  630.        wEdInsString(a)
  631.        Drop(a)
  632.  
  633.  
  634. _&System Information
  635.        wintype="retail"
  636.        if WinMetrics(22) then wintype="debug"
  637.         wcx=WinMetrics(-3)
  638.         math="Math"
  639.         switch wcx
  640.            case 0   ; Win16
  641.                 wc=WinConfig()
  642.                 if !(wc&1) then mode="Real"
  643.                 if wc&16 then mode="Standard"
  644.                 if wc&32 then mode="Enhanced"
  645.                 
  646.                 if wc&64 then cpu=8086
  647.                 if wc&128 then cpu=80186
  648.                 if wc&2 then cpu=286
  649.                 if wc&4 then cpu=386
  650.                 if wc&8 then cpu=486
  651.                 mode = strcat(mode,' ',wintype,' Windows ')
  652.                 if !(wc&1024)  then math="No math"
  653.                 break
  654.           case 1 ; Win32 Intel
  655.                mode="Intel 32-bit %wintype% Windows "
  656.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  657.                break
  658.           case 2 ; Dec Alpha
  659.                mode="DEC Alpha %wintype% Windows NT "
  660.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  661.                break
  662.           case 3 ; MIPS
  663.                mode="MIPS %wintype% Windows NT "
  664.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  665.                break
  666.           case 4 ; PowerPC 
  667.                mode="PowerPC %wintype% Windows NT "
  668.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  669.                break
  670.           case wcx
  671.                cpu= ItemExtract(6,WinSysInfo(),@tab)
  672.                mode="Unknown platform %wintype% Windows  "
  673.         endswitch
  674.  
  675.         Sysinfo=strcat(cpu,' ',mode,WinVersion(1),'.',WinVersion(0),@CRLF)
  676.  
  677.         mouse="No Mouse"
  678.         if WinMetrics(19) then mouse="Mouse"
  679.  
  680.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',@CRLF)
  681.  
  682.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",@CRLF)
  683.  
  684.         ErrorMode(@OFF)
  685.         LastError()
  686.         PlayMedia("Status WaveForm Ready")
  687.         ErrorMode(@CANCEL)
  688.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",@CRLF)
  689.         a=NetInfo(0)
  690.         if a=="MULTINET"
  691.              b=NetInfo(1)
  692.              bug=strcat(b,"network(s) installed")
  693.              ;Message("Multinet supporting  %count% networks", b)
  694.         else
  695.              ;Message("Installed Network", a)
  696.              bug=strcat(a," network installed")
  697.         endif
  698.         sysinfo=strcat(sysinfo,bug,@crlf)
  699.  
  700.  
  701.         switch wcx
  702.            case 0
  703.                bug=WinResources(0)/1024   ; Compute memory avail
  704.                math=strlen(bug)
  705.                if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  706.                sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  707.                sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  708.               break
  709.            case wcx
  710.               bug=WinResources(11)/1024   ; Get Physical memory avail
  711.               sysinfo=strcat(sysinfo,CR,bug," KB Physical Memory",CR)
  712.               bug=(WinResources(14)/1024)+bug   ; Get Virtual memory + Physical avail
  713.               sysinfo=strcat(sysinfo,bug," KB Total Memory",CR)
  714.         end switch
  715.  
  716.  
  717.         sysinfo=strcat(sysinfo,"Console ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),@CRLF)
  718.         disks=DiskScan(1)
  719.         disks=StrReplace(disks,@tab," ")
  720.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,@CRLF)
  721.         disks=DiskScan(2)
  722.         disks=StrReplace(disks,@tab," ")
  723.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,@CRLF)
  724.         disks=DiskScan(4)
  725.         disks=StrReplace(disks,@tab," ")
  726.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,@CRLF)
  727.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),@CRLF)
  728.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),@CRLF)
  729.         sysinfo=strcat(sysinfo,@CRLF,"WIL Interpreter Ver ",VersionDll())
  730.  
  731.         ver=Version()
  732.         Message("%Param2% %ver% SysInfo",Sysinfo)
  733.         Exit
  734.  
  735. Interactive Execution
  736.           if !IsDefined(uyit65) then uyit65="Message( , )"
  737.           :NEXT
  738.           uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
  739.           execute %uyit65%
  740.           goto NEXT
  741.           
  742. _Run a WIL Script File
  743.          if wGetModified()==@TRUE then wFileSave()
  744.          TheFile = WGetFileName()
  745.          Call(TheFile,"")
  746.  
  747.         
  748.